package com.ssj.ssj.modules.man.service;

import com.mybatisflex.core.query.QueryWrapper;
import com.ssj.ssj.modules.man.entity.SUser;
import com.ssj.ssj.modules.man.mapper.SUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

import static com.ssj.ssj.modules.man.entity.table.SUserTableDef.S_USER;


/**
 *  服务实现类
 * @author Tiandy
 * @since 2023-03-10
 */
@Component
public class SUserService {

  @Autowired
  private  SUserMapper sUserMapper;

  public List<SUser> selectList() {
    QueryWrapper query = new QueryWrapper();
    query.where(S_USER.ID.ge(100));
    return sUserMapper.selectListByQuery(query);
  }

  public SUser getByUsername(String username) {
    QueryWrapper query = new QueryWrapper();
    query.where(S_USER.USERNAME.ge(username));
    return sUserMapper.selectOneByQuery(query);
  }

  public List<String> getUserAuthorityInfo(Integer userId) {
    List<String> list = new ArrayList<String>();
    list.add("system:add");
    return list;
  }
}
